<html>
<head><meta charset="utf-8"><title>Tuple elements or tuple fields? · t-lang/doc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/index.html">t-lang/doc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Tuple.20elements.20or.20tuple.20fields.3F.html">Tuple elements or tuple fields?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212468178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Tuple%20elements%20or%20tuple%20fields%3F/near/212468178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Tuple.20elements.20or.20tuple.20fields.3F.html#212468178">(Oct 06 2020 at 18:42)</a>:</h4>
<blockquote>
<p>A tuple type is a heterogeneous product of other types, called the elements of the tuple. It has no nominal name and is instead structurally typed.<br>
-- <a href="https://doc.rust-lang.org/nightly/reference/types/tuple.html">https://doc.rust-lang.org/nightly/reference/types/tuple.html</a></p>
</blockquote>
<p>Anybody have any opinions on not changing that "elements" to "fields"? I don't think I've actually ever seen anybody call them tuple elements outside of this page. (I'm also adding a bunch of obvious but unstated information on tuples to the type and expression pages)</p>



<a name="212485735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Tuple%20elements%20or%20tuple%20fields%3F/near/212485735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Tuple.20elements.20or.20tuple.20fields.3F.html#212485735">(Oct 06 2020 at 21:06)</a>:</h4>
<p>"Elements" seems to be a common term for the members of a tuple in other programming language specs and math texts, though there is a bit of fluidity between the terms. I've always felt like "field" is used more in the context of <em>referring</em> to an element (like <code>.0</code>).</p>



<a name="212491878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Tuple%20elements%20or%20tuple%20fields%3F/near/212491878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Tuple.20elements.20or.20tuple.20fields.3F.html#212491878">(Oct 06 2020 at 22:04)</a>:</h4>
<p>That is <code>field access</code> to me, so of course what it accesses should be called a <code>field</code>, no?</p>



<a name="212492871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Tuple%20elements%20or%20tuple%20fields%3F/near/212492871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Tuple.20elements.20or.20tuple.20fields.3F.html#212492871">(Oct 06 2020 at 22:14)</a>:</h4>
<p><span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span>   I've seen it go both ways.  For example, C# sort dances between the two (<a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-tuples">https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-tuples</a>).  Julia also uses both terms (<a href="https://docs.julialang.org/en/v1/manual/types/#Tuple-Types">https://docs.julialang.org/en/v1/manual/types/#Tuple-Types</a>).  Erlang uses both (<a href="http://erlang.org/doc/programming_examples/records.html">http://erlang.org/doc/programming_examples/records.html</a>).  Pierce calls them "fields".  Swift uses "elements (<a href="https://docs.swift.org/swift-book/ReferenceManual/Types.html">https://docs.swift.org/swift-book/ReferenceManual/Types.html</a>).  C++ uses "elements".  Python typically uses "elements".  I don't feel like the terms are completely synonymous, but I struggle to define how they differ.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>